package com.cmower.journal.cow;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * @author 沉默王二，一枚有趣的程序员
 */
public class CopyOnWriteArrayListDemo {
    public static void main(String[] args) {
List<String> list = new CopyOnWriteArrayList();
list.add("沉默王二");
list.add("沉默王三");
list.add("一个文章真特么有趣的程序员");

for (String str : list) {
    if ("沉默王二".equals(str)) {
        list.remove(str);
    }
}

System.out.println(list);
    }
}
